/**
 * 将时间戳，转换为一个带有格式的字符串
 * @param {*} number 
 * @param {*} showM 
 * @returns 
 */
export default function (number, showM) {
  let date = new Date(+number);
  let years = date.getFullYear().toString().padStart(4, '0');
  let month = (date.getMonth() + 1).toString().padStart(2, '0');
  let day = date.getDate().toString().padStart(2, '0');



  let str = `${years}年${month}月${day}日`;
  if (showM) {
    let hours = date.getHours().toString().padStart(2, '0');
    let minutes = date.getMinutes().toString().padStart(2, '0');
    let seconds = date.getSeconds().toString().padStart(2, '0');

    str += `${hours}时${minutes}分${seconds}秒`
  }
  return str;
}